// 把token 存在Cookie中

import Cookies from 'js-cookie'
const TokenKey = 'hrsaas_hm_75_token'

// cookie的语法和localStorage的语法很相似
// Cookies.set(name,value)
// Cookies.get(name)
// Cookies.remove(name)

/**
 *
 * @returns 从cookie中获取token
 */
export const getToken = () => Cookies.get(TokenKey)
/**
 *设置cookie里面的 token
 * @param {*} token 获取的新token
 * @returns
 */
export const setToken = (token) => Cookies.set(TokenKey, token)

// 移除 Cookie里面的token

export const removeToken = () => Cookies.remove(TokenKey)

